<template>
  <view>
    <view class="query-flex">
      <u-form :model="form" ref="uForm" style="padding: 0 40rpx">
        <u-form-item label="资产编码" label-width="160">
          <u-input v-model="form.depCode"></u-input>
        </u-form-item>
        <u-form-item label="名称" label-width="160">
          <u-input v-model="form.depName" />
        </u-form-item>
        <u-form-item label="图片" label-width="160">
          <u-input v-model="form.img" />
        </u-form-item>
        <u-form-item label="SN" label-width="160">
          <u-input v-model="form.sn" />
        </u-form-item>
        <u-form-item label="金额" label-width="160">
          <u-input v-model="form.money" />
        </u-form-item>
        <u-form-item label="类别" label-width="160" prop="leave">
          <u-select v-model="isleave" :list="list" @confirm="leave"></u-select>
          <u-input v-model="form.leave" type="select" @click="leavePopup" />
        </u-form-item>
        <u-form-item label="规格型号" label-width="160">
          <u-input v-model="form.model" />
        </u-form-item>
        <u-form-item label="区域" label-width="160">
          <u-input v-model="form.region" />
        </u-form-item>
        <u-form-item label="地点" label-width="160">
          <u-input v-model="form.place" />
        </u-form-item>
        <u-form-item label="部门" label-width="160" prop="department">
          <u-select
            v-model="isDepartment"
            :list="lists"
            @confirm="leave"
          ></u-select>
          <u-input
            v-model="form.department"
            type="select"
            @click="departmentPopup"
          />
        </u-form-item>
      </u-form>
    </view>

    <!-- 按钮 -->
    <view class="button-con">
      <view class="button-return">
        <view class="button" @click="Assetlist">确定</view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      form: {
        depCode: "",
        depName: "",
        img: "",
        sn: "",
        money: "",
        leave: "",
        model: "",
        region: "",
        place: "",
        department: "",
      },
      option: {},
      isleave: false, // 类别
      isDepartment: false, // 部门
      radio: "",
      switchVal: false,
      // 年假列表
      list: [
        {
          value: "1",
          label: "DV",
        },
        {
          value: "2",
          label: "PC",
        },
        {
          value: "3",
          label: "TPC",
        },
      ],
      lists: [
        {
          value: "1",
          label: "骨科",
        },
        {
          value: "2",
          label: "CT",
        },
        {
          value: "3",
          label: "眼鼻喉科",
        },
      ],
    };
  },
  methods: {
    // 类别赋值回调
    leave(e) {
      this.form.leave = e[0].label;
    },
    // 类别弹框
    leavePopup() {
      this.isleave = true;
    },
    departmentPopup() {
      this.isDepartment = true;
    },
    Assetlist() {
      uni.navigateTo({
        url: "/pages/eam/Assets/AssetsList/Assetlist",
      });
    },
  },
};
</script>

<style></style>
